package com.atguigu.exer.life02;

import jakarta.servlet.*;

import java.io.IOException;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/12/9 20:56
 * @注释
 */
public class LifeServlet implements Servlet {
    public LifeServlet(){
        System.out.println("LifeServlet()");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("LifeServlet.init()");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("LifeServlet 请求送达了");

        servletResponse.getWriter().println("LifeServlet Response Success");
    }

    @Override
    public String getServletInfo() {
        return "";
    }

    @Override
    public void destroy() {
        System.out.println("LifeServlet destroy");

    }
}
